﻿using System;
using System.Collections.Generic;
using System.Text;
using Neits.PersistenceService;
using System.Windows.Documents;
using System.Collections;

namespace Projecturo.ProjecturoClient.Test.Persistence
{
    public class MockPersistenceService : IPersistenceService
    {
        #region IPersistenceService Member

        public void Delete(object entity)
        {
            throw new NotImplementedException();
        }

        public T Get<T>(long id)
        {
            return (T)MockDatabase.Get(typeof (T), id);
        }

        public IList<T> GetList<T>(Filter filter)
        {
            throw new NotImplementedException();
        }

        public IList<T> GetList<T>()
        {
            IList<T> listToReturn = new List<T>();
            IList foundList = MockDatabase.GetList(typeof(T));
            foreach(object o in foundList)
                listToReturn.Add((T)o);
            return listToReturn;
        }

        public void Refresh(object entity)
        {
            throw new NotImplementedException();
        }

        public void Save(object entity)
        {
            MockDatabase.Add(entity);
        }

        #endregion
    }
}
